<template>
	<view class="page">
		<u-parse  :content="value" />
	</view>
</template>

<script>
	import {
		getxy
	} from "@/request/myApi.js";
	export default {
		data() {
			return {
				name: "", 
				value: "", // 内容
				title: ''
			};
		},
		onLoad(e) {
			this.name = e.name
			this.getData();
		},
		methods: {
			// 获取协议
			getData() {
				let that = this
				getxy().then((res) => {
					if (res.code == 200) {
						that.value = res.data.list.filter(item => item.name == that.name)[0].value
						that.title = res.data.list.filter(item => item.name == that.name)[0].title
						wx.setNavigationBarTitle({
							title: that.title
						})
					}else{
						uni.showToast({
							title: res.msg,
							duration: 1500,
							icon: 'none',
						})
					}
				});
			},
		},
	};
</script>

<style lang="scss" scoped>
	.page {
		word-break: break-all;
		padding: 20rpx 30rpx;

		.empty {
			display: flex;
			flex-direction: column;
			align-items: center;
			text-align: center;
			color: #bababa;
			font-weight: 400;
			font-size: 32rpx;
			line-height: 44rpx;
		}
	}
</style>